This application claims priority to GB Application No. 1313657.7 filed Jul. 31, 2013, the entire contents of which are incorporated herein by reference.
This invention relates to the field of data processing systems. More particularly, this invention relates to the management of the generation and use of error codes associated with data values stored within data blocks within a memory.
It is known to provide memories with error codes derived from the data values stored within those memories. Typically the data values are divided into data blocks comprising a plurality of data values and an error code is generated having a value dependent upon the plurality of data values. Examples of error codes include error correcting codes, parity values and other forms of error detection and correction codes. Error codes may serve to detect errors or to both detect and correct errors. If the data values stored within the memory are corrupted for some reason, such as a soft error due to a particle strike, then the error codes may be used to detect that corruption and potentially correct that corruption. This increases the reliability of the data processing system.
It is known to provide data processing systems in which partial (narrow) writes of data to a block of data stored within a memory may be performed. As one example, an error code may be computed for a data block comprising a word (e.g. 32 bits). If a write to an individual byte within such a word takes place, then the remaining bytes of the word must be read from memory (if not already available) in order to compute the error code. This represents a significant time and energy overhead. As another example, a cache memory may be divided into cache lines with each cache line storing a plurality of data values. An error correction code may be calculated for the plurality of data values constituting a cache line and serves to provide a degree of protection against corruption for the data values held within that cache line. If a write of a data value is made to a memory location which is not currently stored within the cache memory, then a cache line within the cache memory may be allocated to the data block containing that data value. If all of the data values of that cache line are written, then the error correction code for that cache line may be calculated and stored. However, if a partial write of the data values within that cache line is performed, then it is necessary to fetch from the main memory the remaining data values which constitute that cache line in order that the correct error correction code can be determined for that cache line. The error correction code is dependent on all of the data values within the cache line. The necessity to read the data values from elsewhere that have not been written into the cache line causes a significant additional overhead in terms of time and energy. This requirement also requires a more complex design.